import Vue from 'vue';
import App from './App.vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/common.less';
import router from './router';
import store from './store'
import ETable from "@/components/ETable"
import http from '@/http/config'
import '@lib/gloabel'

Vue.config.productionTip = false
Vue.prototype.$http = http
Vue.component('ETable', ETable)

Vue.filter('userStatus', function (value) {
	let val = '-'
	if (value === '1') {
		val = '禁用'
	} else if (value === '0'){
		val = '启用'
	}
	return val
})

Vue.filter('numSeparate', function (value) {
	if (!value) return '0'
	return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
})

Vue.use(ElementUI);
new Vue({
	el:'#app',
	store,
	router,
	render: h => h(App),
})
